<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>小程序登录设计 | 漠北烟云</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="最近有几个同学同事都问过我这个问题,小程序是如何登录的,如何设计一个小程序账号体系,其实小程序官方已经给出了一个稳妥的方案,我也分享了曾经的方法,今天写些实际的东西,我会结合官方文档详细的介绍一下小程序的登录方法设计,希望可以帮到大家. 小程序的code,session_key,unionId,openId开始之前先要对这几个东西又个大概的了解  临时登录凭证code,登录凭证校验。通过 wx.l">
<meta property="og:type" content="article">
<meta property="og:title" content="小程序登录设计">
<meta property="og:url" content="http://example.com/2023/04/02/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%99%BB%E5%BD%95%E8%AE%BE%E8%AE%A1/index.html">
<meta property="og:site_name" content="漠北烟云">
<meta property="og:description" content="最近有几个同学同事都问过我这个问题,小程序是如何登录的,如何设计一个小程序账号体系,其实小程序官方已经给出了一个稳妥的方案,我也分享了曾经的方法,今天写些实际的东西,我会结合官方文档详细的介绍一下小程序的登录方法设计,希望可以帮到大家. 小程序的code,session_key,unionId,openId开始之前先要对这几个东西又个大概的了解  临时登录凭证code,登录凭证校验。通过 wx.l">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://rshobsdhu.hn-bkt.clouddn.com/login.png">
<meta property="og:image" content="http://rshobsdhu.hn-bkt.clouddn.com/2023040222143.png">
<meta property="og:image" content="http://rshobsdhu.hn-bkt.clouddn.com/381660271278_.pic_hd.jpg">
<meta property="article:published_time" content="2023-04-02T12:10:07.000Z">
<meta property="article:modified_time" content="2023-04-02T14:50:49.944Z">
<meta property="article:author" content="mobeiyanyun">
<meta property="article:tag" content="小程序&#x2F;uniapp">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://rshobsdhu.hn-bkt.clouddn.com/login.png">
  
    <link rel="alternate" href="/atom.xml" title="漠北烟云" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css">

  
<meta name="generator" content="Hexo 6.3.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">漠北烟云</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://example.com"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-小程序登录设计" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2023/04/02/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%99%BB%E5%BD%95%E8%AE%BE%E8%AE%A1/" class="article-date">
  <time class="dt-published" datetime="2023-04-02T12:10:07.000Z" itemprop="datePublished">2023-04-02</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="p-name article-title" itemprop="headline name">
      小程序登录设计
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p>最近有几个同学同事都问过我这个问题,小程序是如何登录的,如何设计一个小程序账号体系,其实小程序官方已经给出了一个稳妥的方案,我也分享了曾经的方法,今天写些实际的东西,我会结合官方文档详细的介绍一下小程序的登录方法设计,希望可以帮到大家.</p>
<h4 id="小程序的code-session-key-unionId-openId"><a href="#小程序的code-session-key-unionId-openId" class="headerlink" title="小程序的code,session_key,unionId,openId"></a>小程序的code,session_key,unionId,openId</h4><p>开始之前先要对这几个东西又个大概的了解</p>
<ul>
<li>临时登录凭证code,登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程.</li>
<li>session_key 会话密钥</li>
<li>unionid 用户在开放平台的唯一标识符，若当前小程序已绑定到微信开放平台帐号下会返回，</li>
<li>openid 用户唯一标识<br>这里有些朋友不了解opened和unionid的区别, openid相当于是用户在小程序的唯一凭证,unionid则是微信平台的凭证,openid<br>就像我们的学生证或者工号,只是我们在学校或者公司的凭证,而unionId 就像我们的身份证,只要在中国,这个证件都能通用,如果我们要做账户互通,比如公众号,小程序,企业微信账户互通,那么unionid则至关重要.</li>
</ul>
<h4 id="登录方法"><a href="#登录方法" class="headerlink" title="登录方法"></a>登录方法</h4><p>我使用的是这个流程,这个流程并非一成不变根据需求来<br><img decoding="async" src="http://rshobsdhu.hn-bkt.clouddn.com/login.png"><br>页面启动时先使用wx.login去获取微信的code,将code传到后端,后端获取openid,unionid并判断此用户是否在自己的平台上注册过,如果已经注册可直接静默登录,然而大部分页面其实无需登录,根据当前接口判断是否需要注册,如果需要注册就根据接口返回直接进入登录注册页面. wx.login方法详见<a target="_blank" rel="noopener" href="https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html">https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html</a></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">wx.login(&#123;</span><br><span class="line">  success (res) &#123;</span><br><span class="line">    <span class="keyword">if</span> (res.code) &#123;</span><br><span class="line">      //发起网络请求</span><br><span class="line">      wx.request(&#123;</span><br><span class="line">        url: <span class="string">&#x27;https://example.com/onLogin&#x27;</span>,</span><br><span class="line">        data: &#123;</span><br><span class="line">          code: res.code</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;)</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">      console.log(<span class="string">&#x27;登录失败！&#x27;</span> + res.errMsg)</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>

<h4 id="生成token"><a href="#生成token" class="headerlink" title="生成token"></a>生成token</h4><p>如何让后端生成token便是接下来的目标,首先要清楚登录要素是什么,我们的当时是需要手机号,昵称,和unionid,手机号是为了和app数据(app强制绑定手机号的)可以互通,unioid则是为了和公众号互通(方便内容推送),<br>获取手机号详细见<a target="_blank" rel="noopener" href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html</a><br>获取昵称<a target="_blank" rel="noopener" href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/userProfile.html">https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/userProfile.html</a><br>比较简单不在赘述,需要注意的一点是session_key可能会过期导致手机号无法获取成功,最好获取前checkSession使用检查一下,如果失败了就重新获取session_key还有getPhoneNumber 返回的 code 与 wx.login 返回的 code 作用是不一样的，不能混用。<br>这几大要素齐全了就开始关键的一步:<br><img decoding="async" src="http://rshobsdhu.hn-bkt.clouddn.com/2023040222143.png"></p>
<h4 id="jwt风格的登录"><a href="#jwt风格的登录" class="headerlink" title="jwt风格的登录"></a>jwt风格的登录</h4><p>我们是希望登录时使用jwt风格的登录,所以我封装了几个东西:<br>1、获取token</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="title">getToken</span></span>() &#123;</span><br><span class="line">     uni.login(&#123;</span><br><span class="line">       provider: <span class="string">&quot;weixin&quot;</span>,</span><br><span class="line">       success: (res) =&gt; &#123;</span><br><span class="line">         const code = res.code;</span><br><span class="line">         getToken(code).<span class="keyword">then</span>((res) =&gt; &#123;</span><br><span class="line">           if (res.data.token) &#123;</span><br><span class="line">             uni.setStorageSync(&quot;token&quot;, res.data.token);</span><br><span class="line">             uni.<span class="variable">$emit</span>(&quot;reload&quot;);</span><br><span class="line">             this.goBack();</span><br><span class="line">           &#125; else &#123;</span><br><span class="line">             this.getSessionKey();</span><br><span class="line">           &#125;</span><br><span class="line">         &#125;);</span><br><span class="line">       &#125;,</span><br><span class="line">     &#125;);</span><br><span class="line">   &#125;,</span><br></pre></td></tr></table></figure>
<p>这一步其实就是用code让后端生成 session_key和openid和unionid.登录页面进入时我调用了这个接口,如果用户之前注册过,短暂的loading就直接生成token并返回,如过之前没有登录过就显示授权手机号的按钮.<br>上一步中已经调用getSessionKey()</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="function"><span class="title">getSessionKey</span></span>() &#123;</span><br><span class="line">   uni.login(&#123;</span><br><span class="line">     provider: <span class="string">&quot;weixin&quot;</span>,</span><br><span class="line">     success: (res) =&gt; &#123;</span><br><span class="line">       const code = res.code;</span><br><span class="line">       getCode(code).<span class="keyword">then</span>((res) =&gt; &#123;</span><br><span class="line">         this.sessionKey = res.data.session_key;</span><br><span class="line">         this.openId = res.data.openId;</span><br><span class="line">         this.unionId = res.data.unionId;</span><br><span class="line">       &#125;);</span><br><span class="line">     &#125;,</span><br><span class="line">   &#125;);</span><br><span class="line"> &#125;,</span><br><span class="line"> getPhoneNumber(e) &#123;</span><br><span class="line">   let _this = this;</span><br><span class="line">   uni.checkSession(&#123;</span><br><span class="line">     success() &#123;</span><br><span class="line">       _this.decryptionPhoneNumber(e);</span><br><span class="line">     &#125;,</span><br><span class="line">     fail() &#123;</span><br><span class="line">       _this.getSessionKey();</span><br><span class="line">       _this.<span class="variable">$toast</span>(&quot;请重试&quot;);</span><br><span class="line">     &#125;,</span><br><span class="line">   &#125;);</span><br><span class="line"> &#125;,</span><br><span class="line"> // 解密手机号</span><br><span class="line"> decryptionPhoneNumber(e) &#123;</span><br><span class="line">		</span><br><span class="line">   const &#123; errMsg, encryptedData, iv &#125; = e.detail;</span><br><span class="line">console.log(&#x27;errMsg&#x27;,errMsg)</span><br><span class="line">   if (errMsg == &quot;getPhoneNumber:ok&quot;) &#123;</span><br><span class="line">     let obj = &#123;</span><br><span class="line">       sessionKey: this.sessionKey,</span><br><span class="line">       encryptedData: encryptedData,</span><br><span class="line">       iv: iv,</span><br><span class="line">       openId: this.openId,</span><br><span class="line">       unionId: this.unionId,</span><br><span class="line">       type: <span class="number">3</span>,</span><br><span class="line">     &#125;;</span><br><span class="line">     wxAuthLogin(obj).then((res) =&gt; &#123;</span><br><span class="line">       uni.setStorageSync(&quot;token&quot;, res.data);</span><br><span class="line">       uni.<span class="variable">$emit</span>(&quot;reload&quot;);</span><br><span class="line">       this.goBack();</span><br><span class="line">     &#125;);</span><br><span class="line">   &#125;</span><br><span class="line">else&#123;</span><br><span class="line"> this.<span class="variable">$toast</span>(&#x27;授权失败&#x27;)</span><br><span class="line">&#125;</span><br><span class="line"> &#125;,</span><br><span class="line"> </span><br><span class="line">  </span><br></pre></td></tr></table></figure>
<p>2、请求封装:<br>我们需要把接口请求进一步的封装</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br></pre></td><td class="code"><pre><span class="line">import &#123; baseUrl &#125; from <span class="string">&quot;./getBaseUrl&quot;</span>;// 基础路径</span><br><span class="line">// 错误信息</span><br><span class="line">const tips = &#123;</span><br><span class="line">  1: <span class="string">&quot;抱歉，服务器出现了一个错误&quot;</span>,</span><br><span class="line">&#125;;</span><br><span class="line">class HTTP &#123;</span><br><span class="line">  <span class="function"><span class="title">getPath</span></span>() &#123;</span><br><span class="line">    var pages = getCurrentPages(); // 获取栈实例</span><br><span class="line">    <span class="built_in">let</span> currentRoute = pages[pages.length - 1].route;</span><br><span class="line">    <span class="built_in">return</span> currentRoute;</span><br><span class="line">  &#125;</span><br><span class="line">  request(&#123; url, data = &#123;&#125;, method = <span class="string">&quot;GET&quot;</span>, redirect = <span class="literal">true</span> &#125;) &#123;</span><br><span class="line">    <span class="built_in">return</span> new Promise((resolve, reject) =&gt; &#123;</span><br><span class="line">      this._request(url, resolve, reject, data, method, redirect);</span><br><span class="line">    &#125;);</span><br><span class="line">  &#125;</span><br><span class="line">  _request(url, resolve, reject, data = &#123;&#125;, method = &quot;GET&quot;, redirect) &#123;</span><br><span class="line">    const token = uni.getStorageSync(&quot;token&quot;);</span><br><span class="line">    uni.request(&#123;</span><br><span class="line">      url: baseUrl + url,</span><br><span class="line">      method: method,</span><br><span class="line">      data: data,</span><br><span class="line">      header: &#123;</span><br><span class="line">        &quot;content-type&quot;: &quot;application/json&quot;,</span><br><span class="line">        token: token,</span><br><span class="line">      &#125;,</span><br><span class="line">      success: (res) =&gt; &#123;</span><br><span class="line">        console.log(res, &quot;res&quot;);</span><br><span class="line">        if (res.data.code === &quot;<span class="number">000000</span>&quot;) &#123;</span><br><span class="line">          resolve(res.data);</span><br><span class="line">        &#125; else if (res.data.code === &quot;<span class="number">200000</span>&quot;||res.data.code === &quot;<span class="number">200006</span>&quot;) &#123;</span><br><span class="line">          reject(res.data);</span><br><span class="line">          const path = this.getPath();</span><br><span class="line">          if (redirect &amp;&amp; path != &quot;pages/wxLogin/index&quot;) &#123;</span><br><span class="line">            console.log(path);</span><br><span class="line">            uni.navigateTo(&#123;</span><br><span class="line">              url: &quot;/pages/wxLogin/index&quot;,</span><br><span class="line">            &#125;);</span><br><span class="line">          &#125;</span><br><span class="line">        &#125; else &#123;</span><br><span class="line">          reject(res.data);</span><br><span class="line">          const errorMsg = res.data.message;</span><br><span class="line">          this._show_error(errorMsg);</span><br><span class="line">        &#125;</span><br><span class="line">      &#125;,</span><br><span class="line">      fail: (err) =&gt; &#123;</span><br><span class="line">        console.log(&quot;------&quot;);</span><br><span class="line">        reject(err);</span><br><span class="line">        this._show_error(tips[<span class="number">1</span>]);</span><br><span class="line">      &#125;,</span><br><span class="line">    &#125;);</span><br><span class="line">  &#125;</span><br><span class="line">  _show_error(errorMsg) &#123;</span><br><span class="line">    uni.showToast(&#123;</span><br><span class="line">      title: errorMsg,</span><br><span class="line">      icon: &quot;none&quot;,</span><br><span class="line">      duration: <span class="number">2000</span>,</span><br><span class="line">    &#125;);</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line">export &#123; HTTP &#125;;</span><br></pre></td></tr></table></figure>
<p>到这里一个小程序的登录流程已经完成.开始基础页面的开发吧<br>官方文档:<a target="_blank" rel="noopener" href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html">https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html</a><br><strong>小程序登录-账户体系设计并不难但是却是一切的开始,千万不要出现这种东西:</strong><br><img decoding="async" src="http://rshobsdhu.hn-bkt.clouddn.com/381660271278_.pic_hd.jpg"></p>
<style>
    blockquote {
        margin:1.6em 0px !important;
        text-align: left !important;
    }
</style>
<blockquote>
看似不起眼的日复一日,会在将来的某一天,突然让你看到坚持的意义.
</blockquote>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://example.com/2023/04/02/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%99%BB%E5%BD%95%E8%AE%BE%E8%AE%A1/" data-id="clfziy0oq000bp5r46hbua0vi" data-title="小程序登录设计" class="article-share-link">Share</a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%B0%8F%E7%A8%8B%E5%BA%8F-uniapp/" rel="tag">小程序&#x2F;uniapp</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
  
    <a href="/2023/03/30/%E8%A7%82%E5%AF%9F%E8%80%85%E6%A8%A1%E5%BC%8F/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">vue中的观察者模式</div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/VUE/" rel="tag">VUE</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/js%E5%9F%BA%E7%A1%80/" rel="tag">js基础</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%B0%8F%E7%A8%8B%E5%BA%8F-uniapp/" rel="tag">小程序&#x2F;uniapp</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%B7%B7%E5%90%88%E5%BC%80%E5%8F%91/" rel="tag">混合开发</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/VUE/" style="font-size: 15px;">VUE</a> <a href="/tags/js%E5%9F%BA%E7%A1%80/" style="font-size: 20px;">js基础</a> <a href="/tags/%E5%B0%8F%E7%A8%8B%E5%BA%8F-uniapp/" style="font-size: 10px;">小程序/uniapp</a> <a href="/tags/%E6%B7%B7%E5%90%88%E5%BC%80%E5%8F%91/" style="font-size: 10px;">混合开发</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/04/">April 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/03/">March 2023</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2023/04/02/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%99%BB%E5%BD%95%E8%AE%BE%E8%AE%A1/">小程序登录设计</a>
          </li>
        
          <li>
            <a href="/2023/03/30/%E8%A7%82%E5%AF%9F%E8%80%85%E6%A8%A1%E5%BC%8F/">vue中的观察者模式</a>
          </li>
        
          <li>
            <a href="/2023/03/29/%E6%95%B0%E6%8D%AE%E5%8F%98%E6%9B%B4%E7%9A%84%E7%9B%91%E6%B5%8B/">数据变更的监测</a>
          </li>
        
          <li>
            <a href="/2023/03/26/%E9%97%AD%E5%8C%85/">闭包</a>
          </li>
        
          <li>
            <a href="/2023/03/21/instanceof%E5%8E%9F%E7%90%86/">instanceof原理</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2023 mobeiyanyun<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/js/jquery-3.4.1.min.js"></script>



  
<script src="/fancybox/jquery.fancybox.min.js"></script>




<script src="/js/script.js"></script>





  </div>
</body>
</html>